﻿using System;
using System.Collections.Generic;
using AutoR.Models;
using AutoR.Services;
using Prism.Commands;
using Prism.Mvvm;
using Prism.Navigation;
using Prism.Services;

namespace AutoR.ViewModels.Home
{
	// Token: 0x020000AE RID: 174
	public class DrillViewModel : BindableBase, INavigationAware, INavigatedAware, INavigatingAware
	{
		// Token: 0x170000DB RID: 219
		// (get) Token: 0x0600034C RID: 844 RVA: 0x000494BA File Offset: 0x000476BA
		private INavigationService NavigationService { get; }

		// Token: 0x170000DC RID: 220
		// (get) Token: 0x0600034D RID: 845 RVA: 0x000494C2 File Offset: 0x000476C2
		private IPageDialogService PageDialogService { get; }

		// Token: 0x170000DD RID: 221
		// (get) Token: 0x0600034E RID: 846 RVA: 0x000408F6 File Offset: 0x0003EAF6
		public GameData Game
		{
			get
			{
				return Runtime.Game;
			}
		}

		// Token: 0x170000DE RID: 222
		// (get) Token: 0x0600034F RID: 847 RVA: 0x000494CA File Offset: 0x000476CA
		public DelegateCommand FriendCommand { get; }

		// Token: 0x170000DF RID: 223
		// (get) Token: 0x06000350 RID: 848 RVA: 0x000494D2 File Offset: 0x000476D2
		public DelegateCommand AddRuleCommand { get; }

		// Token: 0x170000E0 RID: 224
		// (get) Token: 0x06000351 RID: 849 RVA: 0x000494DA File Offset: 0x000476DA
		public DelegateCommand AddRule1Command { get; }

		// Token: 0x170000E1 RID: 225
		// (get) Token: 0x06000352 RID: 850 RVA: 0x000494E2 File Offset: 0x000476E2
		public DelegateCommand AddRule2Command { get; }

		// Token: 0x170000E2 RID: 226
		// (get) Token: 0x06000353 RID: 851 RVA: 0x000494EA File Offset: 0x000476EA
		public DelegateCommand AddRule3Command { get; }

		// Token: 0x170000E3 RID: 227
		// (get) Token: 0x06000354 RID: 852 RVA: 0x000494F2 File Offset: 0x000476F2
		public DelegateCommand<IList<int>> FleetCommand { get; }

		// Token: 0x170000E4 RID: 228
		// (get) Token: 0x06000355 RID: 853 RVA: 0x000494FA File Offset: 0x000476FA
		public DelegateCommand<IList<ShipType>> RuleTypeCommand { get; }

		// Token: 0x170000E5 RID: 229
		// (get) Token: 0x06000356 RID: 854 RVA: 0x00049502 File Offset: 0x00047702
		public DelegateCommand<RuleFleet> RuleRemoveCommand { get; }

		// Token: 0x170000E6 RID: 230
		// (get) Token: 0x06000357 RID: 855 RVA: 0x0004950A File Offset: 0x0004770A
		public DelegateCommand<RuleFleet> VisCommand { get; }

		// Token: 0x170000E7 RID: 231
		// (get) Token: 0x06000358 RID: 856 RVA: 0x00049512 File Offset: 0x00047712
		public DelegateCommand<RuleFleet> EquipmentCommand { get; }

		// Token: 0x170000E8 RID: 232
		// (get) Token: 0x06000359 RID: 857 RVA: 0x0004951A File Offset: 0x0004771A
		public DelegateCommand<RuleFleet> Rule1RemoveCommand { get; }

		// Token: 0x170000E9 RID: 233
		// (get) Token: 0x0600035A RID: 858 RVA: 0x00049522 File Offset: 0x00047722
		public DelegateCommand<RuleFleet> Rule2RemoveCommand { get; }

		// Token: 0x170000EA RID: 234
		// (get) Token: 0x0600035B RID: 859 RVA: 0x0004952A File Offset: 0x0004772A
		public DelegateCommand<RuleFleet> Rule3RemoveCommand { get; }

		// Token: 0x170000EB RID: 235
		// (get) Token: 0x0600035C RID: 860 RVA: 0x00049532 File Offset: 0x00047732
		public DelegateCommand AddNode1Command { get; }

		// Token: 0x170000EC RID: 236
		// (get) Token: 0x0600035D RID: 861 RVA: 0x0004953A File Offset: 0x0004773A
		public DelegateCommand<NodeCondition> Remove1Command { get; }

		// Token: 0x170000ED RID: 237
		// (get) Token: 0x0600035E RID: 862 RVA: 0x00049542 File Offset: 0x00047742
		public DelegateCommand AddNode2Command { get; }

		// Token: 0x170000EE RID: 238
		// (get) Token: 0x0600035F RID: 863 RVA: 0x0004954A File Offset: 0x0004774A
		public DelegateCommand<NodeCondition> Remove2Command { get; }

		// Token: 0x170000EF RID: 239
		// (get) Token: 0x06000360 RID: 864 RVA: 0x00049552 File Offset: 0x00047752
		public DelegateCommand AddNode3Command { get; }

		// Token: 0x170000F0 RID: 240
		// (get) Token: 0x06000361 RID: 865 RVA: 0x0004955A File Offset: 0x0004775A
		public DelegateCommand<NodeCondition> Remove3Command { get; }

		// Token: 0x06000362 RID: 866 RVA: 0x00049564 File Offset: 0x00047764
		public DrillViewModel(INavigationService navigationService, IPageDialogService pageDialogService)
		{
			this.NavigationService = navigationService;
			this.PageDialogService = pageDialogService;
			this.FriendCommand = new DelegateCommand(async delegate()
			{
				await this.NavigationService.NavigateAsync("FriendList");
			});
			this.AddRuleCommand = new DelegateCommand(delegate()
			{
				this.Game.DrillTask.RuleFleet.Add(new RuleFleet());
			});
			this.AddRule1Command = new DelegateCommand(delegate()
			{
				this.Game.DrillTask.DrillRule[0].RuleFleet.Add(new RuleFleet());
			});
			this.AddRule2Command = new DelegateCommand(delegate()
			{
				this.Game.DrillTask.DrillRule[1].RuleFleet.Add(new RuleFleet());
			});
			this.AddRule3Command = new DelegateCommand(delegate()
			{
				this.Game.DrillTask.DrillRule[2].RuleFleet.Add(new RuleFleet());
			});
			this.VisCommand = new DelegateCommand<RuleFleet>(delegate(RuleFleet node)
			{
				node.Type = ((node.Type == 2) ? 0 : (node.Type + 1));
			});
			this.RuleTypeCommand = new DelegateCommand<IList<ShipType>>(async delegate(IList<ShipType> list)
			{
				NavigationParameters parameters = new NavigationParameters
				{
					{
						"list",
						list
					}
				};
				await this.NavigationService.NavigateAsync("ShipTypeSelect", parameters);
			});
			this.FleetCommand = new DelegateCommand<IList<int>>(async delegate(IList<int> ship)
			{
				NavigationParameters parameters = new NavigationParameters
				{
					{
						"list",
						ship
					}
				};
				await this.NavigationService.NavigateAsync("ShipMultiSelect", parameters);
			});
			this.EquipmentCommand = new DelegateCommand<RuleFleet>(async delegate(RuleFleet rule)
			{
				NavigationParameters parameters = new NavigationParameters
				{
					{
						"rule",
						rule
					}
				};
				await this.NavigationService.NavigateAsync("SelectEquipment", parameters);
			});
			this.RuleRemoveCommand = new DelegateCommand<RuleFleet>(delegate(RuleFleet node)
			{
				this.Game.DrillTask.RuleFleet.Remove(node);
			});
			this.Rule1RemoveCommand = new DelegateCommand<RuleFleet>(delegate(RuleFleet node)
			{
				this.Game.DrillTask.DrillRule[0].RuleFleet.Remove(node);
			});
			this.Rule2RemoveCommand = new DelegateCommand<RuleFleet>(delegate(RuleFleet node)
			{
				this.Game.DrillTask.DrillRule[1].RuleFleet.Remove(node);
			});
			this.Rule3RemoveCommand = new DelegateCommand<RuleFleet>(delegate(RuleFleet node)
			{
				this.Game.DrillTask.DrillRule[2].RuleFleet.Remove(node);
			});
			this.AddNode1Command = new DelegateCommand(delegate()
			{
				this.Game.DrillTask.DrillRule[0].NodeCondition.Add(new NodeCondition());
			});
			this.AddNode2Command = new DelegateCommand(delegate()
			{
				this.Game.DrillTask.DrillRule[1].NodeCondition.Add(new NodeCondition());
			});
			this.AddNode3Command = new DelegateCommand(delegate()
			{
				this.Game.DrillTask.DrillRule[2].NodeCondition.Add(new NodeCondition());
			});
			this.Remove1Command = new DelegateCommand<NodeCondition>(delegate(NodeCondition node)
			{
				this.Game.DrillTask.DrillRule[0].NodeCondition.Remove(node);
			});
			this.Remove2Command = new DelegateCommand<NodeCondition>(delegate(NodeCondition node)
			{
				this.Game.DrillTask.DrillRule[1].NodeCondition.Remove(node);
			});
			this.Remove3Command = new DelegateCommand<NodeCondition>(delegate(NodeCondition node)
			{
				this.Game.DrillTask.DrillRule[2].NodeCondition.Remove(node);
			});
		}

		// Token: 0x06000363 RID: 867 RVA: 0x0004067F File Offset: 0x0003E87F
		public void OnNavigatedFrom(INavigationParameters parameters)
		{
		}

		// Token: 0x06000364 RID: 868 RVA: 0x0004067F File Offset: 0x0003E87F
		public void OnNavigatedTo(INavigationParameters parameters)
		{
		}

		// Token: 0x06000365 RID: 869 RVA: 0x0004067F File Offset: 0x0003E87F
		public void OnNavigatingTo(INavigationParameters parameters)
		{
		}
	}
}
